package campus.aiit.ssl.dao;

import campus.aiit.ssl.domain.model.Device;
import campus.aiit.ssl.manage.custom.dao.BaseDao;
import campus.aiit.ssl.manage.custom.dao.DaoResultCheck;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author ihaokun
 * @date 2019/12/12 11:39
 */
public interface DeviceDao extends BaseDao<Device> {
    @Override@DaoResultCheck
    int insertSelective(Device record);

    @Override@DaoResultCheck
    int updateByPrimaryKeySelective(Device record);

    @Override@DaoResultCheck
    int deleteByPrimaryKey(Long id);

    @Override
    Device selectByPrimaryKey(Long id);

    List<Map<String, Object>> selectByLocation(Long zoneId, Long buildingId, Long floor, Long roomId, Long typeId, String userId);

    List<Map<String, Object>> selectItemsByPrimaryKey(long id);

    int updateUserByPrimaryKey(String userId, long id);

    int updateUserNull(String userId);

    List<Device> selectByUserId(String ifUserId);

    List<Map<String,Object>> selectByBlock(Long id ,Long roomId, Long typeId,String userId);

    int updateUserByBlockUserId(long blockId,String userId);

    List<Map<String, Object>> getDevice(Map map);

    List<Map<String, Object>> selectUniqueKeys();

    Device selectbycodeipport(String ipAddress, String port, String addressCode);
}